/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "ciclo")
@NamedQueries({
    @NamedQuery(name = "Ciclo.findAll", query = "SELECT c FROM Ciclo c"),
    @NamedQuery(name = "Ciclo.findByNCicId", query = "SELECT c FROM Ciclo c WHERE c.nCicId = :nCicId"),
    @NamedQuery(name = "Ciclo.findByVNombre", query = "SELECT c FROM Ciclo c WHERE c.vNombre = :vNombre"),
    @NamedQuery(name = "Ciclo.findByVEstado", query = "SELECT c FROM Ciclo c WHERE c.vEstado = :vEstado")})
public class Ciclo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "nCicId")
    private Integer nCicId;
    @Size(max = 60)
    @Column(name = "vNombre")
    private String vNombre;
    @Size(max = 1)
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nCicId")
    private List<Grupo> grupoList;

    public Ciclo() {
    }

    public Ciclo(Integer nCicId) {
        this.nCicId = nCicId;
    }

    public Integer getNCicId() {
        return nCicId;
    }

    public void setNCicId(Integer nCicId) {
        this.nCicId = nCicId;
    }

    public String getVNombre() {
        return vNombre;
    }

    public void setVNombre(String vNombre) {
        this.vNombre = vNombre;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Grupo> getGrupoList() {
        return grupoList;
    }

    public void setGrupoList(List<Grupo> grupoList) {
        this.grupoList = grupoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nCicId != null ? nCicId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ciclo)) {
            return false;
        }
        Ciclo other = (Ciclo) object;
        if ((this.nCicId == null && other.nCicId != null) || (this.nCicId != null && !this.nCicId.equals(other.nCicId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Ciclo[ nCicId=" + nCicId + " ]";
    }
    
}
